﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 接口隔离原则
{
    public interface IScore
    {
        void QueryScore();
        void UpdateScore();
        void AddScore();
        void DeleteScore();
        double GetSumScore();
        double GetAvgScore();
        void PrintScore();
        void SendScore();
    }
    //Teacher和student都要实现IScore的方法 有些方法教师或学生根本没必要实现
    public class Teacher : IScore
    {
        public void AddScore()
        {
            throw new NotImplementedException();
        }
        public void DeleteScore()
        {
            throw new NotImplementedException();
        }
        public double GetAvgScore()
        {
            throw new NotImplementedException();
        }
        public double GetSumScore()
        {
            throw new NotImplementedException();
        }
        public void PrintScore()
        {
            throw new NotImplementedException();
        }
        public void QueryScore()
        {
            throw new NotImplementedException();
        }
        public void SendScore()
        {
            throw new NotImplementedException();
        }
        public void UpdateScore()
        {
            throw new NotImplementedException();
        }
    }
    public class Student : IScore
    {
        public void AddScore()
        {
            throw new NotImplementedException();
        }
        public void DeleteScore()
        {
            throw new NotImplementedException();
        }
        public double GetAvgScore()
        {
            throw new NotImplementedException();
        }
        public double GetSumScore()
        {
            throw new NotImplementedException();
        }
        public void PrintScore()
        {
            throw new NotImplementedException();
        }
        public void QueryScore()
        {
            throw new NotImplementedException();
        }
        public void SendScore()
        {
            throw new NotImplementedException();
        }
        public void UpdateScore()
        {
            throw new NotImplementedException();
        }
    }



    //====================================正确做法=======================================
    public interface ITeacherScore
    {
        void AddScore();
        void DeleteScore();
        double GetSumScore();
        double GetAvgScore();
        void PrintScore();
        void SendScore();
    }
    public class Teacher2 : ITeacherScore
    {
        public void AddScore()
        {
            throw new NotImplementedException();
        }
        public void DeleteScore()
        {
            throw new NotImplementedException();
        }
        public double GetAvgScore()
        {
            throw new NotImplementedException();
        }

        public double GetSumScore()
        {
            throw new NotImplementedException();
        }

        public void PrintScore()
        {
            throw new NotImplementedException();
        }

        public void SendScore()
        {
            throw new NotImplementedException();
        }
    }

    public interface IStudentScore
    {
        void QueryScore();
        void PrintScore();
    }
    public class Student2 : IStudentScore
    {
        public void PrintScore()
        {
            throw new NotImplementedException();
        }

        public void QueryScore()
        {
            throw new NotImplementedException();
        }
    }
}
